package com.xiaogang.controller;

import com.xiaogang.model.JzyhPrintParam;
import com.xiaogang.service.JzyhPrintService;
import com.xiaogang.utils.APIRs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ProjectName : jzyhPrint
 * @作者 : 侯小刚
 * @描述 :
 * @创建日期 : 2025/10/14 15:19
 */
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/api/jzyh/")
public class JzyhPrintController {

    @Autowired
    private JzyhPrintService jzyhPrintService;

    @RequestMapping(value = "/print", method = RequestMethod.OPTIONS)
    public void printOptions() {
    }
    @RequestMapping(value = "/savePrinter", method = RequestMethod.OPTIONS)
    public void savePrinterOptions(@RequestBody JzyhPrintParam param) {
    }

    /**
     * 打印
     * @param param
     * @return
     */
    @PostMapping("print")
    public APIRs jzyhPrintFile(@RequestBody JzyhPrintParam param) {
        return jzyhPrintService.jzyhPrintFile(param);
    }

    /**
     * 保存打印机
     * @param JzyhPrintParam
     * @return
     */
    @PostMapping("savePrinter")
    public APIRs savePrinter(@RequestBody JzyhPrintParam JzyhPrintParam) {
       return jzyhPrintService.savePrinter(JzyhPrintParam);
    }

}
